package com.music.client.folders.client.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;

import com.music.client.folders.client.FolderClient;
import com.music.service.folders.beans.Folder;
import com.music.service.folders.exceptions.PermissionDeniedException;
import com.music.service.folders.service.FolderService;

public class FolderClientImpl implements FolderClient {

	private FolderService mFolderService;
	
	
	public boolean addAlbumToFolder(Long pMemberId, Long pFolderId,
			Long pAlbumId) throws PermissionDeniedException {
		return getFolderService().addAlbumToFolder(pMemberId, pFolderId, pAlbumId);
	}

	public boolean addFolder(Long pMemberId, String pFolderName) {
		return getFolderService().addFolder(pMemberId, pFolderName);
	}

	public boolean checkMemberPermissionForFolder(Long pMemberId, Long pFolderId) {
		return getFolderService().checkMemberPermissionForFolder(pMemberId, pFolderId);
	}

	public boolean deleteAlbumFromFolder(Long pMemberId, Long pFolderId,
			Long pAlbumId) throws PermissionDeniedException {
		return getFolderService().deleteAlbumFromFolder(pMemberId, pFolderId, pAlbumId);
	}

	public boolean deleteFolder(Long pMemberId, Long pFolderId) {
		return getFolderService().deleteFolder(pMemberId, pFolderId);
	}

	public boolean editFolderName(Long pMemberId, Long pFolderId,String pFolderName) {
		return getFolderService().editFolderName(pMemberId, pFolderId, pFolderName);
	}

	public List<Folder> viewActiveFolders(Long pMemberId) {
		return getFolderService().viewActiveFolders(pMemberId);
	}

	/**
	 * @return the folderClient
	 */
	public FolderService getFolderService() {
		return mFolderService;
	}

	/**
	 * @param pFolderService the folderClient to set
	 */
	@Required
	public void setFolderService(FolderService pFolderService) {
		mFolderService = pFolderService;
	}

}
